package com.atguigu.e_loop;

public class Test2 {
    public static void main(String[] args) {
        //while循环
        int i = 1; //初始化语句
        //定义sum变量
        int sum = 0;
        while(i <= 5){ //判断条件语句
            //循环体
            sum += i;
            //步进操作
            i++;
        }
        System.out.println("sum = " + sum);
    }
}
